xen/arm: Taint Xen on incompatible DCZID values
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 16 Sep 2021 06:25:39 +0000 (07:25 +0100)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Thu, 16 Sep 2021 21:15:51 +0000 (14:15 -0700)
commitef17eb9d3a89bea120ba3949b73cd482c6173648
tree8a7d33d3581bcb3c4f3b3000030cd37ab7fa1881
parent442d54c4459236bdb7379f89a8ebe7e7dcb4d1de
xen/arm: Taint Xen on incompatible DCZID values

Use arm64 cpu feature sanitization to TAINT Xen if different DCZID values
are found (ftr_dczid is using only STRICT method).
In this case actual memory being cleaned by DC ZVA operations would be
different depending on the cores which could make a guest zeroing too
much or too little memory if it is merged between CPUs.

We could, on processors supporting it, trap access to DCZID_EL0 register
using HFGRTR_EL2 register but this would not solve the case where a
process is being migrated during a copy or if it cached the value of the
register.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/cpufeature.c
xen/arch/arm/cpufeature.c
xen/include/asm-arm/cpufeature.h